home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Apps / Utilities / Hardware / SCSItools / setmtd.c < prev   
C/C++ Source or Header  |  1992-12-26  |  599b  |  31 lines

  1. /*
  2.  * setmtd - set SCSI tape driver to a fixed block size
  3.  *      by John L. Chmielewski
  4.  *      Tue Feb 19, 1991
  5.  */
  6.  
  7. #include <fcntl.h>
  8. #include <sys/types.h>
  9. #include <nextdev/scsireg.h>
  10.  
  11. #define RSTDEVICE       "/dev/rst0"
  12. #define BLOCKSIZE       512
  13.  
  14. main()
  15. {
  16.         int fd, size = BLOCKSIZE;
  17.  
  18.         if ((fd = open(RSTDEVICE, O_RDWR)) < 0)
  19.         {
  20.                 perror(RSTDEVICE);
  21.                 exit(1);
  22.         }
  23.         if (ioctl(fd, MTIOCFIXBLK, &size) < 0)
  24.         {
  25.                 perror("ioctl");
  26.                 exit(1);
  27.         }
  28.         (void) close(fd);
  29.         return 0;
  30. }
  31.